When the URL address contains Chinese or "/", this is required for UrlEncode encoding conversion.First, UrlEncodeThe UrlEncode parameter is a dictionary that converts key-value pairs such as key-value into the format we want. If you're using Python2.
This article illustrates the common functions of Python3 urllib.parse. Share to everyone for your reference, specific as follows:
1. Get URL parameters
>>> from Urllib import parse
>>> url = R '
Article title: future generations of the Lisp language, Scheme language in a simple way. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded
This is normal when the URL address contains Chinese characters or the parameter has Chinese characters, but when such a URL is passed as a parameter (the most common callback ), encode and convert some Chinese characters or even.
1. urlencode
UrlEncode and UrlDecode in PythonPosted on 2013/11/13 16:04:09 79983 people readCategory: PythonWhen the URL address contains Chinese, or the parameters are Chinese, this is quite normal, but the URL as a parameter to pass the time (the most common
Document directory
1. Capture simple web pages
2. Download an object
3. basic use of urllib
4. basic use of urllib2
I recently learned Python again. Unfortunately, I didn't use it for work. I could only use my spare time to play it out.1.
Originally from the blog Park and CSDN1. Calculation functionABS ()--Take absolute valueMax ()--take the maximum of the sequence, including list, tupleMin ()--Take the minimum value of the sequenceLen ()--Take lengthDivmod (A, B)---take a//b divisor
UrlEncode and UrlDecode
When the URL contains Chinese or the parameter contains Chinese, the Chinese or special characters (/, &) need to be encoded for conversion.The essence of UrlEncode: Convert the string to GBK encoding, and then replace
Copyright NOTICE: This article for Bo Master study record, reprint please indicate source () Urlparse ()#Urllib.parse.urlparse (urlstring,scheme= ", allow_fragments=true)#URLString: This is a required entry, that is, the URL to parseresult =
Source Address: http://blog.csdn.net/x_iya/article/details/72889456Tar-C: Create compressed archives-X: Unzip-T: View content-r: Append files to the end of a compressed archive file-U: Update files in original compressed packageThese five are
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.